Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task 33, adding validation id #44

Merged
merged 11 commits into from
Sep 12, 2023
Merged

Conversation

nargis-sultani
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Sep 12, 2023

Coverage report

The coverage rate went from 77.97% to 81.08% ⬆️
The branch rate is 65%.

81.48% of new lines are covered.

Diff Coverage details (click to unfold)

src/validator/checks.py

100% of new lines are covered (94.44% of the complete file).

src/tests/test_checks.py

90% of new lines are covered (83.33% of the complete file).
Missing lines: 25, 26

src/validator/create_schemas.py

0% of new lines are covered (0% of the complete file).
Missing lines: 27, 33, 41

@nargis-sultani
Copy link
Contributor Author

I just noticed that no unit tests were needed for this. The code in the main was just three different examples of instantiating the class, nothing more. Can discuss further.

@@ -868,3 +870,27 @@ def test_with_incorrect_values(self):
)
is False
)


class TestSBLCheck:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this into its own file?
following "test_check_functions.py" name, maybe name the new file to be "test_checks.py"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, that makes sense. Sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove these from test_check_functions since they are moved into test_checks file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I did. Let me check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hadn't committed the test_chec_functions changes

@@ -14,7 +14,7 @@
name="Just a Warning"
)

error_check_implied = SBLCheck(lambda: Truename="Error Check")
error_check_implied = SBLCheck(lambda: True name="Error Check")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not needed. can you revert this?

# This will either be a boolean series or a single bool
check_output = schema_error.check_output
except AttributeError:
check_name = schema_error.check
# this is just a string that we'd need to parse manually
check_output = schema_error.args[0]

print(f"{phase} Validation `{check_name}` failed for column `{column_name}`")
f"{phase} Validation `{check_name}` with id: `{check_id}` \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is missing print.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        print(
            f"{phase} Validation `{check_name}` with id: `{check_id}` failed for column `{column_name}`"
        )

# This will either be a boolean series or a single bool
check_output = schema_error.check_output
except AttributeError:
check_name = schema_error.check
# this is just a string that we'd need to parse manually
check_output = schema_error.args[0]

print(f"{phase} Validation `{check_name}` failed for column `{column_name}`")
print(
f"{phase} Validation `{check_name}` with id: `{check_id}` \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove \ . when you run with it, it adds extra unnecessary tab space:

Phase 1 Validation `po_4_gender_ff.invalid_text_length` with id: `E1060`             failed for column `po_4_gender_ff`

Copy link
Contributor

@aharjati aharjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nargis-sultani nargis-sultani merged commit 2eaf1ae into main Sep 12, 2023
jcadam14 pushed a commit that referenced this pull request May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants